
import java.awt.Color;
import java.awt.Font;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.font.TextLayout;
import java.awt.image.BufferedImage;
import org.jdesktop.swingx.image.GaussianBlurFilter;

/**
 *
 * @author Dark_Wolf
 */
public class TextGlow {
    private String string;
    private Font font;
    private BufferedImage image;
    private FontMetrics fm;
    
    public TextGlow(String string, Font font, FontMetrics fm){
        this.string = "ninja";//string;
        this.font = new Font("Dialog", Font.PLAIN, 10);//new Font(font.getFontName(), font.getStyle(), font.getSize()*2);
        this.fm =  fm;
        createImage();
    }
    
    private void createImage(){
        
        image = new BufferedImage(200, 200, BufferedImage.TYPE_4BYTE_ABGR);
         Graphics2D g2 = image.createGraphics();
        TextLayout layout = new TextLayout("ninja",
                font,
                g2.getFontRenderContext());
        
        g2.setColor(Color.WHITE);
       layout.draw(g2, 0, 0);
       
       g2.dispose();
       //image = new GaussianBlurFilter(2).filter(image,null);

    }
    public BufferedImage getImage()
    {
        return image;
    }
    
    
    
}
